package ambientes;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class BackgroundPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	Image image;

	public BackgroundPanel() {
		try {
			image = (new ImageIcon(getClass().getResource("/images/guitar1.jpg")))
					.getImage();
		} catch (Exception e) {/* handled in paintComponent() */
			System.out.println("erro");
		}
	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		if (image != null)
			g.drawImage(image, 0,0, this); // (image,location x, location
													// y, size x, size y)
	}
}
